let baseURL = '源+/api';
// 是否是H5  重新赋值
// #ifdef H5
baseURL = '/api'
// #endif

const request = (url, config = {}) => {
	return new Promise((resolve, reject)=> {
		uni.showLoading({
			title: '加载中...'
		})
		uni.request({
			url: baseURL + url,
			method: config.method || 'GET',
			data: config.data || '',
			header: {
				
			},
			success: res => {
				resolve(res)
			},
			fail(err) {
				reject(err)
			},
			complete() {
				uni.hideLoading()
			}
			
		})
	})
}

export default request